﻿using System.Web.Routing;

namespace ManagedUIFlow.Infrastructure.Services.Helpers
{
    public static class RequestContextExtensions
    {
        public static string GetKey(this RequestContext context)
        {
            return context.RouteData.GetRequiredString("controller"); 
        }

        public static string GetState(this RequestContext context)
        {
            return context.RouteData.Values["action"] != null ? context.RouteData.Values["action"].ToString() : null;
        }
    }
}